#ifndef IPI_H
#define IPI_H

#include <core/task.h>
#include <core/handler.h>

enum ipi_data_state{
    IPIDATA_TASK_IN = 0,
    IPIDATA_TASK_OUT = 1,
    IPIDATA_TASK_KILL = 2,
    IPIDATA_CALL_FUNC = 3,
    IPIDATA_TASK_IPC = 4,
    IPIDATA_NOT_SET = 5,
};

typedef struct ipi_data_t{
    spinlock_t lock;
    unsigned short state;
    unsigned int target_cpu;
    tcb_t* task;
    handler_t handler;
    void* msg;
}ipi_data_t;

extern ipi_data_t ipi_datas[];

void ipi_setup_handler(void);

#endif
